/**
 * instanceof实现
 * @param {Object} obj
 * @param {Function} Type
 */
export function instanceOf(obj, Type) {
  let proto = obj.__proto__

  while (proto) {
    if (proto === Type.prototype) {
      return true
    }
    proto = proto.__proto__
  }

  return false
}
